<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div>
      <h3>who?</h3>
        <div id="name"></div>
      <img src="img/start.jpg" height="25px" width="75px" id="statr" onclick="kaishi()" >
      <img src="img/end.jpg" height="25px" width="78px" id="end" onclick="jieshu()" >
    </div>
    <script type="text/javascript">
        var x
       function kaishi() {
           var a=["张三","李四","王五"]
           var c= document.getElementById("name")
           var d=0;
           if (!x) {
               x = setInterval(function () {
                   if (d > a.length-1) {
                       d = 0;
                   }
                   c.innerHTML=a[d];
                   d++
               }, 1000)
           }
       }
       function jieshu() {
           clearInterval(x)
       }
    </script>
</body>
</html>